﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using Dm.Domain.Entities;

namespace Dm.Domain.Entities.Configurations
{
    public class EmployeeConfiguration : EntityTypeConfiguration<Employee>
    {
        public EmployeeConfiguration()
        {
            this.HasKey(e => e.EntityId);
            this.Property(c => c.EntityId).HasColumnName("EmployeeId");
            this.Property(c => c.ControlNumber).HasColumnName("EmployeeNumber");
            this.HasOptional(a => a.Address);
            this.HasRequired(u => u.User);
            
        }
    }
}
